#pragma once
#include "orangepch.h"
#include "Orange/Window.h"
#include "Log.h"
#include "Core.h"
#include "Event/ApplicationEvent.h"
#include "ImGui/ImGuiLayer.h"
#include "LayerStack.h"

namespace Orange
{
    class Application
    {
    public:
        Application();
        ~Application();
        void Run();
        void OnEvent(Event &event);
        bool OnWindowClose(WindowCloseEvent &event);
        static Application &Get()
        {
            return *s_instance;
        }

        Window &GetWindow()
        {
            return *m_Window;
        }

        void PushLayer(Layer *layer);
        void PushOverLayer(Layer *layer);
        void PopLayer(Layer *layer);
        void PopOverLayer(Layer *layer);

    private:
        Scope<Window> m_Window;
        bool m_running = true;
        static Application *s_instance;

        ImGuiLayer *m_ImGuiLayer;
        LayerStack m_LayerStack;
    };

    Application *CreateApplication();

}